package com.example.mybatisplus.controller.api;

import com.example.mybatisplus.service.ISysDateService;
import com.google.common.collect.ImmutableMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


/**
 * 登录类
 */
@Slf4j
@RestController
@RequestMapping("api")
public class SysDateController {

    @Resource
    private ISysDateService sysDateService;

    /**
     * 登陆验证
     *
     * @return
     */
    @GetMapping("/sysdate")
    public ImmutableMap<String, String> sysdate() {

        ExecutorService executorService = Executors.newFixedThreadPool( 10 );
        executorService.submit( () -> sysDateService.sysDate() );
        return ImmutableMap.of( "msg", "请求成功" );
    }
}
